package ocutils

import (
	"crypto/md5"
	"encoding/hex"
	"encoding/json"
)

func Json(obj any) string {
	data, _ := json.MarshalIndent(obj, "", " ")
	return string(data)
}

// 生成md5
func Md5(str string) string {
	data := []byte(str)
	sum := md5.Sum(data)

	return hex.EncodeToString(sum[:])
}
